package com.lzy.product.service.impl;

import com.lzy.framework.core.utils.DozerUtils;
import com.lzy.product.dao.ProductInfoClassifyMapperExt;
import com.lzy.product.dtos.ProductInfoClassifyDto;
import com.lzy.product.entity.ProductInfoClassifyKey;
import com.lzy.product.service.ProductInfoClassifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by WIN7 on 2017/11/29.
 */
@Service
public class ProductInfoClassifyServiceImpl implements ProductInfoClassifyService {

    @Autowired
    ProductInfoClassifyMapperExt productInfoClassifyMapperExt;

    @Override
    public Long insert(ProductInfoClassifyDto dto) {
        return productInfoClassifyMapperExt.insertSelective(DozerUtils.map(dto, ProductInfoClassifyKey.class)) > 0 ? 1L : null;
    }

    @Override
    public Boolean update(ProductInfoClassifyDto dto) {
        return null;
    }

    @Override
    public Boolean delete(Long id) {
        return null;
    }

    @Override
    public Boolean remove(Long id) {
        return null;
    }

    @Override
    public ProductInfoClassifyDto findById(Long id) {
        return null;
    }

    @Override
    public List<ProductInfoClassifyDto> query(ProductInfoClassifyDto dto) {
        return null;
    }

    @Override
    public Boolean delPrimaryKey(ProductInfoClassifyDto dto) {
        return productInfoClassifyMapperExt.deleteByPrimaryKey(DozerUtils.map(dto, ProductInfoClassifyKey.class)) > 0;
    }

    @Override
    public ProductInfoClassifyDto selectProductClassify(ProductInfoClassifyDto dto) {
        return productInfoClassifyMapperExt.selectProductClassify(dto);
    }

    @Override
    public List<ProductInfoClassifyDto> selectList(ProductInfoClassifyDto dto) {
        return productInfoClassifyMapperExt.selectList(dto);
    }

    @Override
    public Boolean updateByKey(ProductInfoClassifyDto dto) {
        return productInfoClassifyMapperExt.updateByKey(dto) > 0;
    }

    @Override
    public Boolean deleteProductInfoClassify(ProductInfoClassifyDto dto) {
        return productInfoClassifyMapperExt.deleteProductInfoClassify(dto)>0;
    }
}
